<html xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1"
      t:render="main">
  <head>
    <style>
      th, .even td, .odd td {
        padding-right: 0.5em;
        font-family: monospace;
      }
      .even-dir {
        background-color: #efe0ef;
      }
      .even {
        background-color: #eee;
      }
      .odd-dir {
        background-color: #f0d0ef;
      }
      .odd {
        background-color: #dedede;
      }
      .icon {
        text-align: center;
      }
      .listing {
        margin-left: auto;
        margin-right: auto;
        width: 50%;
        padding: 0.1em;
      }
      .content {
        padding-left: 10px;
        padding-right: 10px;
      }
      body {
        border: 0;
        padding: 0;
        margin: 0;
        background-color: #efefef;
      }
      h1 {
        padding: 0.1em;
        padding-left:10px;
        padding-right:10px;
        background-color: #777;
        color: white;
        border-bottom: thin white dashed;
      }
    </style>
    <title>Calendar Server Web Administration</title>
  </head>
  <body>
    <h1>Calendar Server Web Administration</h1>
    <div class="content">
      <h2>Resource Management</h2>
      <form id="frm_resource" name="resourceForm">
        Search for resource to manage:
        <input type="text" id="txt_resourceSearch" name="resourceSearch"
        size="40"><t:attr name="value"><t:slot name="resourceSearch"
        /></t:attr></input>
        <input type="submit" value="Search" />
      </form>
      <div t:render="noSearchResults" style="margin-top:4px"
        >No matches found for resource <b><t:slot name="resourceSearch" /></b>.
      </div>
      <table id="tab_searchResults" t:render="hasSearchResults" cellspacing="0"
             cellpadding="3" border="1" style="margin-top: 2px">
        <tr class="odd">
          <th>ID</th>
          <th>Full Name</th>
          <th>Type</th>
          <th>Short Names</th>
          <th>Email Addresses</th>
        </tr>
        <tr t:render="searchResults">
          <t:attr name="class"><t:slot name="rowClass" /></t:attr>
          <td><a>select<t:attr name="href" >/admin/?resourceId=<t:slot name="uid" /></t:attr></a></td>
          <td><t:slot name="name" /></td>
          <td><t:slot name="typeStr" /></td>
          <td><t:slot name="shortNames" /></td>
          <td><t:slot name="emails" /></td>
        </tr>
      </table>
      <div style="margin-top:15px; background-color: #777;
                  border-bottom:1px #ffffff dotted"></div>
      <div style="background-color: #777; padding-top:2px;
                  border-bottom:1px #ffffff dotted"></div>

      <t:transparent t:render="resourceDetails">
      <h3>Resource Details: <t:slot name="resourceTitle" /></h3>

      <!-- autoScheduleHtml -->

      <t:transparent t:render="autoSchedule">
      <div style="margin-top:15px; border-bottom:1px #444444 dotted"></div>
      <form id="frm_autoSchedule" name="autoScheduleForm" action="/admin/"
        style="margin-top:15px">
        <input type="hidden" id="hdn_resourceId" name="resourceId"
        ><t:attr name="value"><t:slot name="resourceId" /></t:attr></input>
        <div style="margin-top:7px">
          Auto-Schedule Mode
          <select id="sel_autoScheduleMode" name="autoScheduleMode">
            <option t:render="autoScheduleModeNone" value="none">None</option>
            <option t:render="autoScheduleModeAcceptAlways" value="accept-always">Accept Always</option>
            <option t:render="autoScheduleModeDeclineAlways" value="decline-always">Decline Always</option>
            <option t:render="autoScheduleModeAcceptIfFree" value="accept-if-free">Accept If Free</option>
            <option t:render="autoScheduleModeDeclineIfBusy" value="decline-if-busy">Decline If Busy</option>
            <option t:render="autoScheduleModeAutomatic" value="automatic">Automatic (Accept and Decline)</option>
          </select>
          <br/>
          <input type="submit" value="Change" />
        </div>
      </form>
      </t:transparent>

      <!-- currentProxiesHtml -->
      <div style="margin-top:15px; border-bottom:1px #444444 dotted"></div>
      <form id="frm_proxies" name="proxiesForm" action="/admin/"
        style="margin-top:15px">
        <input type="hidden" id="hdn_resourceId" name="resourceId"
        ><t:attr name="value"><t:slot name="resourceId" /></t:attr></input>
        <div t:render="noProxies" style="margin-top:15px"
          >This resource has no proxies.</div>
        <table cellspacing="0" cellpadding="3" border="1"
          t:render="hasProxies">
          <tr class="odd">
            <th colspan="2">Read-Only Proxies</th>
            <th colspan="2">Read-Write Proxies</th>
          </tr>
          <tr t:render="proxyRows">
            <t:attr name="class"><t:slot name="rowClass" /> </t:attr>
            <t:transparent t:render="readOnlyProxies">
            <td><t:slot name="proxy" /></td>
            <td>
              <input type="submit" value="Make Read-Write"><t:attr
              name="name">mkWriteProxy|<t:slot name="uid"/></t:attr></input>
              <input type="submit" value="Remove Proxy"><t:attr
              name="name">rmProxy|<t:slot name="uid"/></t:attr></input>
            </td>
            </t:transparent>

            <t:transparent t:render="noReadOnlyProxies">
            <td colspan="2"></td>
            </t:transparent>
            <t:transparent t:render="readWriteProxies">
            <td><t:slot name="proxy" /></td>
            <td>
              <input type="submit" value="Make Read-Only"><t:attr
              name="name">mkReadProxy|<t:slot name="uid"/></t:attr></input>
              <input type="submit" value="Remove Proxy"><t:attr
              name="name">rmProxy|<t:slot name="uid"/></t:attr></input>
            </td>
            </t:transparent>
            <t:transparent t:render="noReadWriteProxies">
            <td colspan="2"></td>
            </t:transparent>
          </tr>
        </table>
      </form>

      <!-- proxySearchHtml -->

      <div style="margin-top:15px; border-bottom:1px #444444 dotted"></div>
      <div t:render="noProxyResults"
        style="margin-top:4px"
        >No matches found for proxy resource <b><t:slot
          name="proxySearch" /></b>.</div>
      <form id="frm_proxySearch" name="proxySearchForm" action="/admin/"
        style="margin-top:15px; margin-bottom:0; padding-bottom:0">
        Search to add proxies:
        <input type="hidden" id="hdn_resourceId" name="resourceId"
        ><t:attr name="value"><t:slot name="resourceId" /></t:attr></input>
        <input type="text" id="txt_proxySearch" name="proxySearch" size="40"
        ><t:attr name="value"><t:slot name="proxySearch" /></t:attr></input>
        <input type="submit" value="Search"></input>
      </form>
      <form t:render="hasProxyResults"
        id="frm_proxyAdd" name="proxyAddForm" action="/admin/"
        style="margin-top:2px; padding-top:0">
        <input type="hidden" id="hdn_resourceId" name="resourceId"
        ><t:attr name="value"><t:slot name="resourceId" /></t:attr></input>
        <table cellspacing="0" cellpadding="3" border="1">
          <tr class="odd">
            <th>Full Name</th>
            <th>Type</th>
            <th>Short Names</th>
            <th>Email Addresses</th>
            <th></th>
          </tr>
          <tr t:render="proxySearchRows">
            <t:attr name="class"><t:slot name="rowClass" /> </t:attr>
            <td><t:slot name="name" /></td>
            <td><t:slot name="typeStr" /></td>
            <td><t:slot name="shortNames" /></td>
            <td><t:slot name="emails" /></td>
            <td>
              <input type="submit" value="Make Read-Only Proxy"><t:attr
              name="name">mkReadProxy|<t:slot name="uid"/></t:attr></input>
              <input type="submit" value="Make Read-Write Proxy"><t:attr
              name="name">mkWriteProxy|<t:slot name="uid"/></t:attr></input>
            </td>
          </tr>
        </table>
      </form>
      </t:transparent>
    </div>

  </body>
</html>
